import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { JobForm, JobQuery, JobPageResult } from "./types";


export function getJobPage( queryParams?: JobQuery ): AxiosPromise<JobPageResult> {
    return request({
      url: "/admin/job/page",
      method: "get",
      params: queryParams,
    });
}


export function getJob(id: number): AxiosPromise<JobForm> {
    return request({
      url: "/admin/job/" + id,
      method: "get",
    });
}

export function addJob(data: JobForm) {
    return request({
      url: "/admin/job",
      method: "post",
      data: data,
    });
}

export function updateJob(id: number, data: JobForm) {
    return request({
      url: "/admin/job/" + id,
      method: "put",
      data: data,
    });
}

export function delJob(ids: any) {
    return request({
      url: "/admin/job",
      method: "delete",
      data: ids,
    });
}
  